package com.zpp.wedding_admin.utils;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;
import java.util.Map;

public class PageUtils {
    public static<T> Map getPage(Long currentPage, Long size, Class<T> type) {
        Page<Class<T>> page = new Page<>(currentPage, size);
        List<Class<T>> records = page.getRecords();
        Map<String, Object> map = RootMap.getMap();
        map.put("total", page.getTotal());
        map.put("data", records);
        return map;
    }

    public static<T> LambdaQueryWrapper getLQW(Class<T> tClass) {
        return new LambdaQueryWrapper<T>();
    }
}
